//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Chart
{
    public
        class Layout : IOfficeXmlSerializable
    {
        internal const string xmlName = "layout";
        private ExtensionElement _extLst;

        private ManualLayout manualLayout;

        public ManualLayout ManualLayout
        {
            get { return manualLayout; }
            set { manualLayout = value; }
        }

        public ExtensionElement Extension
        {
            get { return _extLst; }
            set { _extLst = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("layout"))
            {
                ManualLayout = c.ReadOptionalElement<ManualLayout>("manualLayout");
                Extension = c.ReadOptionalElement<ExtensionElement>("extLst");
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("layout"))
            {
                c.WriteOptionalElement(ManualLayout);
                c.WriteOptionalElement(Extension);
            }
        }

        #endregion
    }
}